<style type="text/css">
<!--
	.tag0 {width: 186px;}
	.tag1 {width: 186px; height:32px !important; font-size: 12px !important; border:1px solid #B3B3B3; resize: none;}
	.tag2 {width: 186px; height:22px; border:1px solid #B3B3B3;}
	.tag5 {width: 186px; border:1px solid #B3B3B3;}
-->
</style>

<script type="text/javascript">
<!--
	// 定义全局数组gbAllDynamicItems，用于保存用户信息页面所有配置的用户资料项
	var gbAllDynamicItems = new Array();
	
	// 创建select标签
	function createSelectTag(biiId, biiContent, bmiValue){
		var selectTag = $("#" + biiId);
		var contentArray = Utils.splitStr(biiContent, "，");
		
		if (contentArray != null && contentArray.length > 0) {
			var option = "";
			
			for (var i = 0; i < contentArray.length; i++) {
				if(contentArray[i] == bmiValue){
					option = $("<option selected='selected'>" + contentArray[i] + "</option>");
				}else{
					option = $("<option>" + contentArray[i] + "</option>");
				}
				
				selectTag.append(option);
			}
		}
	}
	
	// 创建单选按钮
	function createRadioTag(biiId, biiContent, bmiValue){
		var contentArray = Utils.splitStr(biiContent, "，");
		
		for (var i = 0, j = 1; i < contentArray.length; i++, j++) {
			var brTag = "<br/>";
			var htmlTag = "<input type='radio' name='"+ biiId +"' value='" + contentArray[i] + "'/><span>" + contentArray[i] + "</span>";
			
			if(j % 4 == 0){
				htmlTag += brTag;
			}
			
			document.write(htmlTag);
			
			if(contentArray[i] == bmiValue){
				$("input:radio[name='" + biiId + "']").attr("checked", true);
			}
		}
		
		
	}
	
	// 创建复选框
	function createCheckboxTag(biiId, biiContent, bmiValue){
		var contentArray = Utils.splitStr(biiContent, "，");
		var valueArray = Utils.splitStr(bmiValue, "，");
		
		for (var i = 0, j = 1; i < contentArray.length; i++, j++) {
			var brTag = "<br/>";
			var htmlTag = "<input type='checkbox' name='"+ biiId +"' value='" + contentArray[i] + "'/><span>" + contentArray[i] + "</span>";
			
			if(j % 4 == 0){
				htmlTag += brTag;
			}
			
			document.write(htmlTag);
		}
		
		if(valueArray != null && valueArray.length > 0){
			$("input:checkbox[name='" + biiId + "']").each(function() { 
				for(var k = 0; k < valueArray.length; k++){
					if(this.value == valueArray[k]){
						this.checked = true; 
					}
				}
			}); 
		}
	}
//-->
</script>

[#-- 创建注册会员问题列表自定义宏--]
[#macro ecs_ud_amItems par_allMemberItems]
	[#if par_allMemberItems ??]
		[#list par_allMemberItems as data] 
			<script type="text/javascript">
				<!--
					gbAllDynamicItems[gbAllDynamicItems.length] = ["${data.biiId}==${data.biiType}"];
				//-->
			</script>
			<tr>
	            <td width="28%" align="right" bgcolor="#FFFFFF">${data.biiName}</td>
	            <td width="72%" align="left" bgcolor="#FFFFFF">
	            	[#assign bmiValue = ((data.bmiValue)! "")]
	            	[#assign biiContent = ((data.biiContent)! "")]
	            	
	            	[#-- 说明：biiType为资料项类型（0-文本框，1-文本域，2-下拉选择框，3-单选框，4-复选框，5-时间类型） --]
					[#switch data.biiType]
						[#case 0]
							<input type="text" id="${data.biiId}" class="inputBg tag0" value="${bmiValue}"/>
							[#break]
						[#case 1]
							<textarea id="${data.biiId}" class="inputBg tag1">${bmiValue}</textarea>
							[#break]
						[#case 2]
							<select id="${data.biiId}" class="tag2"></select>
		
							<script type="text/javascript">
								<!--
									createSelectTag("${data.biiId}", "${biiContent}", "${bmiValue}");
								//-->
							</script>
							[#break]
						[#case 3]
							[#if data.biiContent ??]
								<script type="text/javascript">
									<!--
										createRadioTag("${data.biiId}", "${biiContent}", "${bmiValue}");
									//-->
								</script>
							[/#if]
							[#break]
						[#case 4]
							[#if data.biiContent ??]
								<script type="text/javascript">
									<!--
										createCheckboxTag("${data.biiId}", "${biiContent}", "${bmiValue}");
									//-->
								</script>
							[/#if]
							[#break]
						[#case 5]
							<input type="text" id="${data.biiId}" class="Wdate tag5" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd' })" value="${bmiValue}"/>
							[#break]
					[/#switch]
	            </td>
	         </tr>
		[/#list]
	[/#if]
[/#macro]
